package com.meng.file.session;

public class CurrentSession {
    private final static ThreadLocal<String>  requestId = new ThreadLocal<>();
    private final static ThreadLocal<String>  session = new ThreadLocal<>();

    public static void setRequestId(String reqId) {
        requestId.set(reqId);
    }

    public static String getRequestId() {
        String reqId = requestId.get();
        return reqId == null ? "" : reqId;
    }

    public static void setSession(String sessionParam) {
        session.set(sessionParam);
    }

    public static String getSession() {
        String sessionParam = requestId.get();
        return sessionParam == null ? "admin" : sessionParam;
    }
}
